<template>
	<uni-grid :column="4" :square="true" :showBorder="false" class="my-1">
		<uni-grid-item v-for="(item,index) in navList" :key="index">
			<view class="flex justify-center bg-white my-1" @click="navClickHandler(item)">
				<image :src="item.url" style="width: 128rpx;height: 140rpx;"></image>
			</view>
		</uni-grid-item>
	</uni-grid>
</template>

<script setup>
	defineProps({
		navList: Array
	})

	const navClickHandler = (item) => {
		switch (item.name) {
			case "分类":
				// statements_1
				uni.switchTab({
					url: "/pages/cate/cate"
				})
				console.log(item.name)
				break;
			case "秒杀拍":
				// statements_2
				console.log(item.name)
				break;
			case "超市购":
				// statements_2
				console.log(item.name)
				break;
			case "母婴品":
				// statements_2
				console.log(item.name)
				break;
			default:
				// statements_def
				console.log(item.name)
				break;
		}
	}
</script>

<style>

</style>